package com.tramy.data.export.model;

import org.springframework.beans.BeanUtils;

import java.util.Date;

public class CupSettlement {
    private Long id;

    private String customerCode;

    private String customerName;

    private String customerAid;

    private String customerOldCode;

    private String customerDescribe;

    private String customerStatus;

    private Long customerTypeId;

    private Long customerLevelId;

    private Long customerCategoryId;

    private Long checkCycleId;

    private Integer paymentDays;

    private String taxCode;

    private String openBank;

    private String account;

    private String accountName;

    private String kingdeeInterface;

    private Integer coverCustomerNumber;

    private Long createId;

    private Date createTime;

    private Date updateTime;

    private String remark;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getCustomerCode() {
        return customerCode;
    }

    public void setCustomerCode(String customerCode) {
        this.customerCode = customerCode == null ? null : customerCode.trim();
    }

    public String getCustomerName() {
        return customerName;
    }

    public void setCustomerName(String customerName) {
        this.customerName = customerName == null ? null : customerName.trim();
    }

    public String getCustomerAid() {
        return customerAid;
    }

    public void setCustomerAid(String customerAid) {
        this.customerAid = customerAid == null ? null : customerAid.trim();
    }

    public String getCustomerOldCode() {
        return customerOldCode;
    }

    public void setCustomerOldCode(String customerOldCode) {
        this.customerOldCode = customerOldCode == null ? null : customerOldCode.trim();
    }

    public String getCustomerDescribe() {
        return customerDescribe;
    }

    public void setCustomerDescribe(String customerDescribe) {
        this.customerDescribe = customerDescribe == null ? null : customerDescribe.trim();
    }

    public String getCustomerStatus() {
        return customerStatus;
    }

    public void setCustomerStatus(String customerStatus) {
        this.customerStatus = customerStatus == null ? null : customerStatus.trim();
    }

    public Long getCustomerTypeId() {
        return customerTypeId;
    }

    public void setCustomerTypeId(Long customerTypeId) {
        this.customerTypeId = customerTypeId;
    }

    public Long getCustomerLevelId() {
        return customerLevelId;
    }

    public void setCustomerLevelId(Long customerLevelId) {
        this.customerLevelId = customerLevelId;
    }

    public Long getCustomerCategoryId() {
        return customerCategoryId;
    }

    public void setCustomerCategoryId(Long customerCategoryId) {
        this.customerCategoryId = customerCategoryId;
    }

    public Long getCheckCycleId() {
        return checkCycleId;
    }

    public void setCheckCycleId(Long checkCycleId) {
        this.checkCycleId = checkCycleId;
    }

    public Integer getPaymentDays() {
        return paymentDays;
    }

    public void setPaymentDays(Integer paymentDays) {
        this.paymentDays = paymentDays;
    }

    public String getTaxCode() {
        return taxCode;
    }

    public void setTaxCode(String taxCode) {
        this.taxCode = taxCode == null ? null : taxCode.trim();
    }

    public String getOpenBank() {
        return openBank;
    }

    public void setOpenBank(String openBank) {
        this.openBank = openBank == null ? null : openBank.trim();
    }

    public String getAccount() {
        return account;
    }

    public void setAccount(String account) {
        this.account = account == null ? null : account.trim();
    }

    public String getAccountName() {
        return accountName;
    }

    public void setAccountName(String accountName) {
        this.accountName = accountName == null ? null : accountName.trim();
    }

    public String getKingdeeInterface() {
        return kingdeeInterface;
    }

    public void setKingdeeInterface(String kingdeeInterface) {
        this.kingdeeInterface = kingdeeInterface == null ? null : kingdeeInterface.trim();
    }

    public Integer getCoverCustomerNumber() {
        return coverCustomerNumber;
    }

    public void setCoverCustomerNumber(Integer coverCustomerNumber) {
        this.coverCustomerNumber = coverCustomerNumber;
    }

    public Long getCreateId() {
        return createId;
    }

    public void setCreateId(Long createId) {
        this.createId = createId;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark == null ? null : remark.trim();
    }

    @Override
    public String toString() {
        return "CupSettlement{" +
                "id=" + id +
                ", customerCode='" + customerCode + '\'' +
                ", customerName='" + customerName + '\'' +
                ", customerAid='" + customerAid + '\'' +
                ", customerOldCode='" + customerOldCode + '\'' +
                ", customerDescribe='" + customerDescribe + '\'' +
                ", customerStatus='" + customerStatus + '\'' +
                ", customerTypeId=" + customerTypeId +
                ", customerLevelId=" + customerLevelId +
                ", customerCategoryId=" + customerCategoryId +
                ", checkCycleId=" + checkCycleId +
                ", paymentDays=" + paymentDays +
                ", taxCode='" + taxCode + '\'' +
                ", openBank='" + openBank + '\'' +
                ", account='" + account + '\'' +
                ", accountName='" + accountName + '\'' +
                ", kingdeeInterface='" + kingdeeInterface + '\'' +
                ", coverCustomerNumber=" + coverCustomerNumber +
                ", createId=" + createId +
                ", createTime=" + createTime +
                ", updateTime=" + updateTime +
                ", remark='" + remark + '\'' +
                '}';
    }

    /**
     * 详细处理结账客户信息
     * @param settlementCustomer
     * @return
     */
    public CupSettlement convert(SettlementCustomer settlementCustomer){
        CupSettlement result = new CupSettlement();
        BeanUtils.copyProperties(settlementCustomer,result);
        result.setId(settlementCustomer.getCustomerId().longValue());
        result.setCustomerCode(settlementCustomer.getCustomerCode());
        result.setCustomerName(settlementCustomer.getCustomerName());
        result.setCustomerAid(settlementCustomer.getCustomerAid());
        result.setCustomerOldCode(settlementCustomer.getCustomerOldCode());
        result.setCustomerDescribe(settlementCustomer.getCustomerDescribe());
        if(null != settlementCustomer.getCustomerStatus()){
            if(settlementCustomer.getCustomerStatus().equals("1")){
                result.setCustomerStatus("0");
            }else {
                result.setCustomerStatus("1");
            }
        }
        result.setCreateTime(settlementCustomer.getCreateTime());
        result.setUpdateTime(settlementCustomer.getUpdateTime());
        return result;
    }

}